

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Ceph 的升级 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Cephadm Operations" href="../operations/" />
    <link rel="prev" title="SNMP Gateway Service" href="../services/snmp-gateway/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Cephadm</a> &raquo;</li>
        
      <li>Ceph 的升级</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/cephadm/upgrade.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Cephadm</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../compatibility/">Compatibility and Stability</a></li>
<li class="toctree-l2"><a class="reference internal" href="../install/">部署个全新的 Ceph 集群</a></li>
<li class="toctree-l2"><a class="reference internal" href="../adoption/">现有集群切换到 cephadm</a></li>
<li class="toctree-l2"><a class="reference internal" href="../host-management/">Host Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../services/">Service Management</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Ceph 的升级</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#starting-the-upgrade">Starting the upgrade</a></li>
<li class="toctree-l3"><a class="reference internal" href="#monitoring-the-upgrade">Monitoring the upgrade</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#watching-the-progress-bar-during-a-ceph-upgrade">Watching the progress bar during a Ceph upgrade</a></li>
<li class="toctree-l4"><a class="reference internal" href="#watching-the-cephadm-log-during-an-upgrade">Watching the cephadm log during an upgrade</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#canceling-an-upgrade">Canceling an upgrade</a></li>
<li class="toctree-l3"><a class="reference internal" href="#potential-problems">Potential problems</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#upgrade-no-standby-mgr">UPGRADE_NO_STANDBY_MGR</a></li>
<li class="toctree-l4"><a class="reference internal" href="#upgrade-failed-pull">UPGRADE_FAILED_PULL</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#using-customized-container-images">Using customized container images</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../operations/">Cephadm operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../client-setup/">Client Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">Troubleshooting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../dev/cephadm/">Cephadm Feature Planning</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="ceph">
<h1>Ceph 的升级<a class="headerlink" href="#ceph" title="Permalink to this headline">¶</a></h1>
<div class="admonition danger">
<p class="admonition-title">Danger</p>
<p>DATE: 01 NOV 2021.</p>
<p>DO NOT UPGRADE TO CEPH PACIFIC FROM AN OLDER VERSION.</p>
<p>A recently-discovered bug (<a class="reference external" href="https://tracker.ceph.com/issues/53062">https://tracker.ceph.com/issues/53062</a>) can cause
data corruption. This bug occurs during OMAP format conversion for
clusters that are updated to Pacific. New clusters are not affected by this
bug.</p>
<p>The trigger for this bug is BlueStore’s repair/quick-fix functionality. This
bug can be triggered in two known ways:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>manually via the ceph-bluestore-tool, or</p></li>
<li><p>automatically, by OSD if <code class="docutils literal notranslate"><span class="pre">bluestore_fsck_quick_fix_on_mount</span></code> is set
to true.</p></li>
</ol>
</div></blockquote>
<p>The fix for this bug is expected to be available in Ceph v16.2.7.</p>
<p>DO NOT set <code class="docutils literal notranslate"><span class="pre">bluestore_quick_fix_on_mount</span></code> to true. If it is currently
set to true in your configuration, immediately set it to false.</p>
<p>DO NOT run <code class="docutils literal notranslate"><span class="pre">ceph-bluestore-tool</span></code>’s repair/quick-fix commands.</p>
</div>
<p>Cephadm can safely upgrade Ceph from one bugfix release to the next.  For
example, you can upgrade from v15.2.0 (the first Octopus release) to the next
point release, v15.2.1.</p>
<p>The automated upgrade process follows Ceph best practices.  For example:</p>
<ul class="simple">
<li><p>The upgrade order starts with managers, monitors, then other daemons.</p></li>
<li><p>Each daemon is restarted only after Ceph indicates that the cluster
will remain available.</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The Ceph cluster health status is likely to switch to
<code class="docutils literal notranslate"><span class="pre">HEALTH_WARNING</span></code> during the upgrade.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>In case a host of the cluster is offline, the upgrade is paused.</p>
</div>
<div class="section" id="starting-the-upgrade">
<h2>Starting the upgrade<a class="headerlink" href="#starting-the-upgrade" title="Permalink to this headline">¶</a></h2>
<p>Before you use cephadm to upgrade Ceph, verify that all hosts are currently online and that your cluster is healthy by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "# ";
}
</style><span class="prompt1">ceph -s</span>
</pre></div></div><p>To upgrade (or downgrade) to a specific release, run the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade start --ceph-version &lt;version&gt;</span>
</pre></div></div><p>For example, to upgrade to v16.2.6, run the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade start --ceph-version <span class="m">16</span>.2.6</span>
</pre></div></div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>From version v16.2.6 the Docker Hub registry is no longer used, so if you use Docker you have to point it to the image in the quay.io registry:</p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade start --image quay.io/ceph/ceph:v16.2.6</span>
</pre></div></div></div>
<div class="section" id="monitoring-the-upgrade">
<h2>Monitoring the upgrade<a class="headerlink" href="#monitoring-the-upgrade" title="Permalink to this headline">¶</a></h2>
<p>Determine (1) whether an upgrade is in progress and (2) which version the
cluster is upgrading to by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade status</span>
</pre></div></div><div class="section" id="watching-the-progress-bar-during-a-ceph-upgrade">
<h3>Watching the progress bar during a Ceph upgrade<a class="headerlink" href="#watching-the-progress-bar-during-a-ceph-upgrade" title="Permalink to this headline">¶</a></h3>
<p>During the upgrade, a progress bar is visible in the ceph status output. It
looks like this:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"># </span>ceph -s

<span class="go">[...]</span>
<span class="go">  progress:</span>
<span class="go">    Upgrade to docker.io/ceph/ceph:v15.2.1 (00h 20m 12s)</span>
<span class="go">      [=======.....................] (time remaining: 01h 43m 31s)</span>
</pre></div>
</div>
</div>
<div class="section" id="watching-the-cephadm-log-during-an-upgrade">
<h3>Watching the cephadm log during an upgrade<a class="headerlink" href="#watching-the-cephadm-log-during-an-upgrade" title="Permalink to this headline">¶</a></h3>
<p>Watch the cephadm log by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph -W cephadm</span>
</pre></div></div></div>
</div>
<div class="section" id="canceling-an-upgrade">
<h2>Canceling an upgrade<a class="headerlink" href="#canceling-an-upgrade" title="Permalink to this headline">¶</a></h2>
<p>You can stop the upgrade process at any time by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade stop</span>
</pre></div></div></div>
<div class="section" id="potential-problems">
<h2>Potential problems<a class="headerlink" href="#potential-problems" title="Permalink to this headline">¶</a></h2>
<p>There are a few health alerts that can arise during the upgrade process.</p>
<div class="section" id="upgrade-no-standby-mgr">
<h3>UPGRADE_NO_STANDBY_MGR<a class="headerlink" href="#upgrade-no-standby-mgr" title="Permalink to this headline">¶</a></h3>
<p>This alert (<code class="docutils literal notranslate"><span class="pre">UPGRADE_NO_STANDBY_MGR</span></code>) means that Ceph does not detect an
active standby manager daemon. In order to proceed with the upgrade, Ceph
requires an active standby manager daemon (which you can think of in this
context as “a second manager”).</p>
<p>You can ensure that Cephadm is configured to run 2 (or more) managers by
running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch apply mgr <span class="m">2</span>  <span class="c1"># or more</span></span>
</pre></div></div><p>You can check the status of existing mgr daemons by running the following
command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch ps --daemon-type mgr</span>
</pre></div></div><p>If an existing mgr daemon has stopped, you can try to restart it by running the
following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch daemon restart &lt;name&gt;</span>
</pre></div></div></div>
<div class="section" id="upgrade-failed-pull">
<h3>UPGRADE_FAILED_PULL<a class="headerlink" href="#upgrade-failed-pull" title="Permalink to this headline">¶</a></h3>
<p>This alert (<code class="docutils literal notranslate"><span class="pre">UPGRADE_FAILED_PULL</span></code>) means that Ceph was unable to pull the
container image for the target version. This can happen if you specify a
version or container image that does not exist (e.g. “1.2.3”), or if the
container registry can not be reached by one or more hosts in the cluster.</p>
<p>To cancel the existing upgrade and to specify a different target version, run
the following commands:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade stop</span>
<span class="prompt1">ceph orch upgrade start --ceph-version &lt;version&gt;</span>
</pre></div></div></div>
</div>
<div class="section" id="using-customized-container-images">
<h2>Using customized container images<a class="headerlink" href="#using-customized-container-images" title="Permalink to this headline">¶</a></h2>
<p>For most users, upgrading requires nothing more complicated than specifying the
Ceph version number to upgrade to.  In such cases, cephadm locates the specific
Ceph container image to use by combining the <code class="docutils literal notranslate"><span class="pre">container_image_base</span></code>
configuration option (default: <code class="docutils literal notranslate"><span class="pre">docker.io/ceph/ceph</span></code>) with a tag of
<code class="docutils literal notranslate"><span class="pre">vX.Y.Z</span></code>.</p>
<p>But it is possible to upgrade to an arbitrary container image, if that’s what
you need. For example, the following command upgrades to a development build:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch upgrade start --image quay.io/ceph-ci/ceph:recent-git-branch-name</span>
</pre></div></div><p>For more information about available container images, see <a class="reference internal" href="../../install/containers/#containers"><span class="std std-ref">Ceph 容器映像</span></a>.</p>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../operations/" class="btn btn-neutral float-right" title="Cephadm Operations" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../services/snmp-gateway/" class="btn btn-neutral float-left" title="SNMP Gateway Service" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>